{
  // 需求:
  // 描述平面坐标, 用于描述2d平面坐标对象的类型

  // 1. 接口的数据类型的继承
  interface IPoint2D {
    x: number
    y: number
  }

  interface IPoint3D extends IPoint2D {
    z: number
  }
  const point2D: IPoint2D = {
    x: 100,
    y: 200,
  }

  const point3D: IPoint3D = {
    x: 100,
    y: 200,
    z: 300,
  }

  // 2. 类型的 &
  type Point2D = {
    x: number
    y: number
  }

  type Point3D = {
    z: number
  } & Point2D

  const point2D1: Point2D = {
    x: 100,
    y: 200,
  }

  const point3D1: Point3D = {
    x: 100,
    y: 200,
    z: 300,
  }
}
